home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_inf_introscene.cog < prev    next >
Text File  |  1999-11-15  |  5KB  |  170 lines

  1. # Jones 3D Cog Script
  2. #
  3. # INF_introsceme.cog
  4. #
  5. # [SXC]
  6. #
  7. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  8. # ========================================================================================
  9.  
  10. symbols
  11.  
  12.     message     startup
  13.     message     user0
  14.     message     entered
  15.    
  16.     thing       player                              local
  17.     thing       indyactor
  18.     thing       block
  19.     
  20.     thing       actor_sight0
  21.     thing       actor_sight1
  22.     thing       actor_mark0
  23.     thing       spinpos
  24.     thing       finalcampos
  25.     
  26.     thing       cam0
  27.     thing       cam0_tgt0
  28.     thing       cam1
  29.     thing       cam1_tgt0
  30.     
  31.     thing       fadeplane
  32.     thing       liftstone
  33.     
  34.     keyframe    inStand1=0in_stand4.key             local
  35.     keyframe    in_stand4=0in_stand4.key            local
  36.     keyframe    in_SideToHips=0in_stand1_bd_4.key   local
  37.     keyframe    in_HipsToSide=0in_stand4_bd_1.key   local
  38.     keyframe    in_thinking=0in_thinking_4_4.key    local
  39.     
  40.     sound       indyline0=im01j01.wav               local
  41.     sound       indyline1=im01j02.wav               local
  42.     sound       theme=mus_inf_intro.WAV             local
  43.     
  44.     int         checkit=0                           local
  45.     int         themechan=0                         local
  46.     int         in_track0                           local
  47.     int         scenechek=0                         local
  48.  
  49.     int            bSeen=0                                local
  50.     
  51. end
  52.  
  53. code
  54.  
  55. # ========================================================================================
  56.  
  57. startup:
  58.  
  59.     SetMasterCog(GetSelfCog()); # RT: Set master cog so we get autosave/restore message
  60.  
  61.     Sleep(0.001); # Let engine get set up
  62.  
  63.     # Start on black...
  64.     SetCameraLookInterp(2, 0);
  65.     SetCameraPosInterp(2, 0);
  66.     SetCameraFocus(2, cam0);
  67.     SetCameraSecondaryFocus(2, cam0_tgt0);
  68.     SetCurrentCamera(2);
  69.     SetCameraFOV(80, 0, 0);
  70.  
  71.     return;
  72.  
  73. # ..............................................................................
  74.  
  75. user0: # RT: Indicates that autosave/restore has completed...
  76.  
  77.     if (bSeen) return; # RT
  78.     bSeen = 1;
  79.  
  80.     player = GetLocalPlayerThing();
  81.  
  82.     SetCameraLookInterp(2, 0);
  83.     SetCameraPosInterp(2, 0);
  84.     SetCameraFocus(2, cam0);
  85.     SetCameraSecondaryFocus(2, cam0_tgt0);
  86.     SetCurrentCamera(2);
  87.     SetCameraFOV(80, 0, 0);
  88.  
  89.     //timesaver check
  90.     AttachThingtoThing(block, liftstone);
  91.     SetCollideType(block, 0);
  92.     sleep(0.001);
  93.     StartCutscene(1);
  94.     
  95.     //fadein
  96.     AttachThingToThing(fadeplane, cam0);
  97.     ThingFadeAnim(fadeplane, 1, 0, 1, 0);
  98.     
  99.     //start the scene
  100.     themechan=PlaySoundLocal(theme, 1, 0, 0x0, 0);
  101.     CopyPlayerHolsters(player, indyactor);
  102.     SetActorFlags(player, 0x200000);
  103.     SetThingFlags(player, 0x80000);
  104.     ClearThingFlags(indyactor, 0x80000);
  105.     
  106.     //move lift stone down and walk actor in and move to first mark
  107.     MoveToFrame(liftstone, 1, 1);
  108.     WaitForStop(liftstone);
  109.     Sleep(0.75);
  110.     AISetCutsceneMode(indyactor);
  111.     AISetMoveSpeed(indyactor, 0.9);
  112.     AISetLookThing(indyactor, actor_sight0);
  113.     AISetMoveFrame(indyactor, 1);
  114.     AISetLookThing(indyactor, actor_sight1);
  115.     
  116.     //start to move Camera in
  117.     SetCameraLookInterp(2, 1);
  118.     SetCameraPosInterp(2, 1);
  119.     SetCameraInterpSpeed(2, 3);
  120.     Sleep(0.01);
  121.     SetCameraFocus(2, cam1);
  122.     SetCameraSecondaryFocus(2, cam1_tgt0);
  123.     SetCameraFOV(60, 1, 2);
  124.     AIWaitForStop(indyactor);
  125.     
  126.     //play keys and voice files
  127.     SetCameraFocus(2, finalcampos);
  128.     SetCameraFOV(90, 1, 3);
  129.     in_track0 = PlayKey(indyactor, in_stand4, 2, 0x00, 0);
  130.     PlayKey(indyactor, in_SideToHips, 4, 0x12, 1);
  131.     Sleep(1);
  132.     PlayVoice(indyactor, indyline0, 1, 1);
  133.     PlayVoice(indyactor, indyline1, 1, 0);
  134.     PlayKey(indyactor, in_thinking, 4, 0x12, 1);
  135.     StopKey(indyactor, in_track0, 0.25);
  136.     Sleep(0.5);
  137.     
  138.     //Restore Everything
  139.     CopyOrientAndPos(indyactor, player);
  140.     SetCameraLookInterp(2, 0);
  141.     SetCameraPosInterp(2, 0);
  142.     SetCameraInterpSpeed(2, 0);
  143.     Sleep(0.01);
  144.     SetCameraPosition(1, GetThingPos(finalcampos));
  145.     ClearThingFlags(player, 0x80000);
  146.     SetThingFlags(indyactor, 0x80000);
  147.  
  148.     ResetCameraFOV(0, 0.0);
  149.     SetCurrentCamera(1);
  150.     EndCutscene();
  151.     ClearActorFlags(player, 0x200000);
  152.     scenechek=1;
  153.     SetCollideType(block, 3);
  154.         
  155. return;
  156.         
  157. #----------------------------------------------------------------------------------------
  158. entered:
  159.  
  160.     if (scenechek == 1)
  161.     {
  162.         scenechek = 2;
  163.         MoveToFrame(liftstone, 2, 2);
  164.     }
  165.     
  166. return;
  167.  
  168. #----------------------------------------------------------------------------------------
  169.  
  170. end